<?php
/**
 * Joomla! 1.5 component PB-Roster
 *
 * @version $Id: pbroster.php 2010-09-10 10:03:33 svn $
 * @author ML@pixelbyte.dk
 * @package Joomla
 * @subpackage PB-Roster
 * @copyright (C) 2010- pixelbyte.dk
 * @license GNU/GPL
 *
 * A World of Warcraft Guild Roster
 *
 */
header('Content-type: text/html; charset=utf-8'); 

$name = urldecode($_GET["n"]); // ie chokes on special chars
$level = $_GET["l"];
$race = $_GET["r"];
$lrace = urldecode($_GET["lr"]);
$gender = $_GET["g"];
$lgender = urldecode($_GET["lg"]);
$class = $_GET["c"];
$lclass = urldecode($_GET["lc"]);
$hname = urldecode($_GET["name"]);
$hlevel = urldecode($_GET["level"]);
$hrace = urldecode($_GET["race"]);
$hclass = urldecode($_GET["class"]);
$path = $_GET["path"];

if ($name == "") {
?>
  <div class="adminGetUser_wrapper">
    <table cellpadding="0" cellspacing="0" border="0" id="table" class="adminGetUserTable">
      <tr>
	    <th width="55px"><?php echo $hlevel; ?></th>
        <th><?php echo $hname; ?></th>
        <th width="50px"><?php echo $hrace; ?></th>
        <th width="50px"><?php echo $hclass; ?></th>
      </tr>
	  
      <tr>
        <td class="getuser">&nbsp;</td>
        <td class="getuser">&nbsp;</td>
        <td class="getuser">&nbsp;</td>
        <td class="getuser">&nbsp;</td>
      </tr>
    </table>
  </div>
<?php
}
else {
?>
  <div class="adminGetUser_wrapper">
    <table cellpadding="0" cellspacing="0" border="0" id="table" class="adminGetUserTable">
      <tr>
	    <th width="55px"><?php echo $hlevel; ?></th>
        <th><?php echo $hname; ?></th>
        <th width="50px"><?php echo $hrace; ?></th>
        <th width="50px"><?php echo $hclass; ?></th>
      </tr>

      <tr>
	    <td class="getuser"><?php echo $level; ?></td>
        <td class="getuser"><?php echo '<span style="color:'.return_class_color($class).'">'.$name.'</span>'; ?></td>
        <td class="getuser"><img style="border: 1px solid #1c1c1c;" src="<?php echo $path; ?>icons/races/small/<?php echo $race; ?>-<?php echo $gender; ?>.jpg" title="<?php echo $lrace; ?> <?php echo $lgender; ?>" height=20 align="right"></td>
        <td class="getuser"><img style="border: 1px solid #1c1c1c;" height=20 align="left" src="<?php echo $path; ?>icons/classes/small/<?php echo $class; ?>.jpg" title="<?php echo $lclass; ?>"></td>
      </tr>
    </table>
  </div>
<?php
}

function return_class_color($classid) {
    switch ($classid) {
        case  1: $class = "#C79C6E";      break;
        case  2: $class = "#F58CBA";      break;
        case  3: $class = "#ABD473";      break;
        case  4: $class = "#FFF569";      break;
        case  5: $class = "#FFFFFF";      break;
        case  6: $class = "#C41F3B";      break;
        case  7: $class = "#2459FF";      break;
        case  8: $class = "#69CCF0";      break;
        case  9: $class = "#9482C9";      break;
        case 11: $class = "#FF7D0A";      break;
    }
    return $class;
}

?> 